package com.archive.manage;

import com.archive.manage.domain.StuArchive;
import com.archive.manage.domain.entity.ArchiveParams;
import com.archive.manage.domain.entity.ArchiveRequestEntity;

public class Utils {
    public static ArchiveRequestEntity generateBlockChainRequestEntity(String ccname, String channel, String caller, String id) {
        return ArchiveRequestEntity.builder()
                .ccname(ccname)
                .channel(channel)
                .caller(caller)
                .params(ArchiveParams.builder().id(id).build())
                .build();
    }

    public static ArchiveRequestEntity generateBlockChainRequestEntity(String ccname, String channel, String caller, String operator, StuArchive archive) {
        ArchiveRequestEntity entity = generateBlockChainRequestEntity(ccname, channel, caller, archive.getStudentId());
        entity.getParams().setData(archive);
        entity.getParams().setOperator(operator);
        return entity;
    }
}
